﻿<%@ Page Title="" Language="C#" MasterPageFile="~/default.Master" AutoEventWireup="true"
    CodeBehind="CorrectMaintain.aspx.cs" Inherits="InstrumentCheck.WebAppUI.CorrectMaintain" %>

<%@ Register Src="UserControl/UCSelectAssetNO.ascx" TagName="UCSelectAssetNO" TagPrefix="uc1" %>
<%@ Register Src="UserControl/UCSelectPR.ascx" TagName="UCSelectPR" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" src="js/Calendar/WdatePicker.js"></script>

    <script type="text/javascript" src="js/Maintain.js"></script>
    
    <style type="text/css">
        .style1
        {
            text-align: left;
            border-color: Black;
            border-style: groove;
            height: 30px;
            font-weight: bold;
            width: 545px;
        }
        .style2
        {
            text-align: left;
            border-color: Black;
            border-style: groove;
            height: 30px;
            font-weight: bold;
            width: 64px;
        }
        .style3
        {
            font-size: larger;
            text-align: center;
            border-color: Black;
            border-style: groove;
            height: 30px;
            font-weight: bold;
            width: 109px;
        }
        .style4
        {
            font-size: larger;
            text-align: center;
            border-color: Black;
            border-style: groove;
            height: 30px;
            font-weight: bold;
            width: 141px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table width="800" border="1" cellspacing="0" cellpadding="0" rules="all" frame="box"
        style="border-style: groove; border-color: Black;">
        <tr>
            <td colspan="3" class="desc">
                儀 校 設 備 基 本 資 料
            </td>
        </tr>
        <tr>
            <td class="style2" rowspan="2">
                <table>
                    <tr>
                        <td>
                            <asp:Button ID="btnAdd" runat="server" CssClass="mainButton" Text="新 增" OnClick="btnAdd_Click" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnUpdate" runat="server" CssClass="mainButton" Text="修 改" OnClick="btnUpdate_Click" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnSave" runat="server" CssClass="mainButton" Text="儲 存" Enabled="False"
                                OnClick="btnSave_Click" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnCancel" runat="server" CssClass="mainButton" Text="取 消" Enabled="False"
                                OnClick="btnCancel_Click" /><br />
                            <br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnPrevious" runat="server" CssClass="mainButton" Text="上一筆" OnClick="btnPrevious_Click" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnNext" runat="server" CssClass="mainButton" Text="下一筆" OnClick="btnNext_Click" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input type="button" runat="server" class="mainButton" value="查 詢" ID="btnQuery" onclick="ShowChoiceDiv('divQuery',600,400)" /><br />
                            <br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:Label ID="lblCount" runat="server" CssClass="label" Text="15/145"></asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
            <td class="style1">
                <table border="1" cellspacing="0" cellpadding="0" rules="all" frame="box" width="100%">
                    <tr>
                        <td class="style3">
                            資產類別:
                        </td>
                        <td class="descData">
                            <asp:DropDownList runat="server" ID="ddlAssetType" CssClass="mustDropDownList">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="1">固定資產</asp:ListItem>
                                <asp:ListItem Value="2">列管品</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            購買日期:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ID="txtBuyDate" CssClass="must" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            資產編號:
                        </td>
                        <td class="descData" colspan="3">
                            <asp:TextBox ID="txtAssetNO" runat="server" CssClass="must" Width="124px" />
                            <img src="images/imgFind.png" alt="Find" onclick="ShowChoiceDiv('divAsset',600,400)" id="imgBtnFindAssetNO" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            購買幣別:
                        </td>
                        <td class="descData">
                            <asp:DropDownList ID="ddlBuyCurrency" runat="server" Height="16px" Width="122px"
                                SkinID="mustDropDownList">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="NTD">NTD</asp:ListItem>
                                <asp:ListItem Value="USD">USD</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            金額:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ID="txtBuyAmount" SkinID="mustTextBox" onkeypress="return checkNumber(event);"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            儀器品名:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblChiName" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                        <td class="style4">
                            建檔日期:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ID="txtCreateDate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})"
                                CssClass="must" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            儀器規格:
                        </td>
                        <td colspan="3" class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblSpec" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            儀器型號:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblModuleNO" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                        <td class="style4">
                            首校日期:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ID="txtFirstCorrectDate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})"
                                CssClass="must" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            &nbsp;儀器廠牌:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblBrand" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                        <td class="style4">
                            應校日期:
                        </td>
                        <td class="descData">
                            <asp:TextBox ID="txtNeedCorrectDate" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy/MM/dd'})"
                                runat="server" CssClass="must" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            &nbsp;校驗結果:
                        </td>
                        <td class="descData">
                            <asp:DropDownList runat="server" ID="ddlCorrectStatus" SkinID="mustDropDownList">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="1">合格</asp:ListItem>
                                <asp:ListItem Value="2">限定使用</asp:ListItem>
                                <asp:ListItem Value="0">不合格</asp:ListItem>
                                <asp:ListItem Value="3">不需填写</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            下次校驗日期:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblNextCorrectDate" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            保管人:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblKeeper" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                        <td class="style4">
                            保管部門:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ContentEditable="false" ID="lblKeepDept" Width="95%" CssClass="label"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            校驗區分:
                        </td>
                        <td class="descData">
                            <asp:DropDownList runat="server" ID="ddlCorrectType" CssClass="mustDropDownList">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="1">內校</asp:ListItem>
                                <asp:ListItem Value="2">外校</asp:ListItem>
                                <asp:ListItem Value="3">不需填写</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            目前狀況:
                        </td>
                        <td class="descData">
                            <asp:DropDownList ID="ddlCurrentStatus" runat="server" 
                                CssClass="mustDropDownList" onchange="ChangeStatus(this)">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="1">需校驗</asp:ListItem>
                                <asp:ListItem Value="4">免驗</asp:ListItem>
                                <asp:ListItem Value="5">暫停使用</asp:ListItem>
                                <asp:ListItem Value="6">禁止使用</asp:ListItem>
                                <asp:ListItem Value="7">報廢</asp:ListItem>
                            </asp:DropDownList>
                            
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            校驗幣別:
                        </td>
                        <td class="descData">
                            <asp:DropDownList ID="ddlCorrectCurrency" runat="server" Height="16px" Width="125px"
                                SkinID="mustDropDownList">
                                <asp:ListItem Value=""></asp:ListItem>
                                <asp:ListItem Value="NTD">NTD</asp:ListItem>
                                <asp:ListItem Value="USD">USD</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="style4">
                            費用:
                        </td>
                        <td class="descData">
                            <asp:TextBox runat="server" ID="txtCorrectAmount" CssClass="must" onkeypress="return checkNumber(event);"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="desc">
                            PR單號
                        </td>
                        <td colspan="3" class="descData">
                            <asp:TextBox runat="server" ID="txtPRNO" CssClass="must" />
                            <img src="images/imgFind.png" alt="Find" onclick="ShowChoiceDiv('divPR',400,300)" runat="server" id="imgBtnFindPRNO" />
                            <asp:TextBox ID="txtAttachInfo" runat="server" Width="50px" CssClass="hide"></asp:TextBox>
                            <asp:TextBox ID="txtImageInfo" runat="server" Width="45px" CssClass="hide"></asp:TextBox>
                            <asp:Button ID="btnImage" runat="server" onclick="btnImage_Click" CssClass="hide"/>
                            <asp:Button ID="btnAttach" runat="server" onclick="btnAttach_Click" CssClass="hide"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            附件:
                        </td>
                        <td class="descData" colspan="3">
                            <asp:Label runat="server" ID="lblCorrectAttach" Width="94%" />
                            <img alt="Upload Attachment" src="images/imgAttachment.gif" onclick="ShowChoiceDiv('divAttach',600,400)" runat="server" id="imgBtnUpload" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            允收標準:
                        </td>
                        <td colspan="3" class="descData">
                            <asp:TextBox runat="server" ID="txtStandard" MaxLength="4000" TextMode="MultiLine"
                                Width="96%" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style3">
                            備註欄:
                        </td>
                        <td colspan="3" class="descData">
                            <asp:TextBox runat="server" ID="txtRemark" MaxLength="4000" TextMode="MultiLine"
                                Width="96%" />
                        </td>
                    </tr>
                </table>
            </td>
            <td class="descData" align="center">
                <table border="1" cellspacing="0" cellpadding="0" rules="all" frame="box" width="100%">
                    <tr>
                        <td class="descData" align="center">
                            <asp:UpdatePanel ID="updatepanel6" runat="server">
                                <ContentTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td colspan="2" align="center">
                                                <asp:Image ID="imageItem" runat="server" AlternateText="儀器圖片" Width="170px" 
                                                    Height="210px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <br />
                                                <asp:Button ID="btnUploadImage" runat="server" CssClass="mainButton" Text="上傳圖片"
                                                    Enabled="False" OnClientClick="ShowChoiceDiv('divImages',600,400)" /><br />
                                                <br />
                                            </td>
                                            <td align="center">
                                                <br />
                                                <asp:Button ID="btnDeleteImage" runat="server" CssClass="mainButton" Text="刪除圖片"
                                                    Enabled="False" OnClick="btnDeleteImage_Click" /><br />
                                                <br />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <asp:Button ID="btnPreviousImage" runat="server" CssClass="mainButton" Text="上一張"
                                                    OnClick="btnPreviousImage_Click" /><br />
                                                <br />
                                            </td>
                                            <td align="center">
                                                <asp:Button ID="btnNextImage" runat="server" CssClass="mainButton" Text="下一張" OnClick="btnNextImage_Click" /><br />
                                                <br />
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
        </tr>
        <tr>
            <td class="descData">
                <table width="100%">
                    <tr>
                        <td>
                            校驗週期:
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:RadioButtonList ID="rblCorrectCycle" runat="server">
                                <asp:ListItem Value="1">半年</asp:ListItem>
                                <asp:ListItem Value="2">一年</asp:ListItem>
                                <asp:ListItem Value="3">兩年</asp:ListItem>
                                <asp:ListItem Value="4">不需填写</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="descData">
                <table width="100%">
                    <tr>
                        <td>
                            送校狀態:
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:RadioButtonList ID="rblIsCorrect" runat="server">
                                <asp:ListItem Value="0">已送校</asp:ListItem>
                                <asp:ListItem Value="1">已回廠</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </td> </tr>
    <tr>
        <td colspan="2" class="descData">
            <table width="100%" border="1" cellspacing="0" cellpadding="0" rules="all" frame="box">
                <tr>
                    <td class="desc">
                        歷程記錄:
                    </td>
                </tr>
                <tr>
                    <td class="descData">
                        <asp:GridView ID="gvForm" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvForm_RowDataBound">
                            <Columns>
                                <asp:BoundField HeaderText="校驗歷程" />
                                <asp:TemplateField HeaderText="申請單號">
                                    <ItemTemplate>
                                        <asp:Label ID="lblFormNO" runat="server"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="應校日期" />
                                <asp:BoundField HeaderText="校驗週期" />
                                <asp:BoundField HeaderText="下次校驗日期" />
                                <asp:BoundField HeaderText="歷程記錄" />
                                <asp:BoundField HeaderText="申請原因" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    </table>
    <div id="divBack" oncontextmenu="return false" style="position: absolute; top: 0px;
        filter: alpha(opacity=90); background-color: #777777; z-index: 2; left: 0px;
        display: none;">
    </div>
    <div id="divAsset" align="center" style="position: absolute; z-index: 3; background-color: #ffffef;
        display: none;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <uc1:UCSelectAssetNO ID="UCSelectAssetNO1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div id="divQuery" style="position: absolute; z-index: 3; background-color: #ffffef;
        display: none; text-align: center">
       
                <table style="width: 600px;background-color:White;vertical-align:top;">
    <tr style="background-color:#A9BFF9;height:10px;">
        <td style="text-align:left;" colspan="3">
            <table>
                <tr>
                    <td style="width:98%;text-align:left;font-weight:bold;">儀器校驗系統</td>
                    <td style="width:2%;text-align:right"><img src="images/close.jpg" alt="Close" onclick="Unlock();" onmouseover="this.style.cursor='hand'" /></td>
                </tr>
            </table> 
        </td>
    </tr>
    <tr>
        <td colspan="2" align="center">
            請輸入查詢條件：
        </td>       
    </tr>
    <tr>
        <td align="right">
            資產編號：</td><td align="left"> <asp:TextBox ID="tAssetNO" runat="server"></asp:TextBox>
            
        </td>       
    </tr>
    <tr>
        <td align="right">
            品名：</td><td align="left"><asp:TextBox ID="tChiName" runat="server"></asp:TextBox>
            
        </td>       
    </tr>
    <tr>
        <td align="right">
            部門代號：</td><td align="left"><asp:TextBox ID="tKeepDept" runat="server"></asp:TextBox>
        </td>       
    </tr>
    <tr>
        <td colspan="2" align="center">
            <asp:Button ID="btnFind" class="mainButton" runat="server" Text="開始查找" OnClientClick="Unlock();" onclick="btnFind_Click" />
        </td>       
    </tr>
</table>
           
    </div>
    <div id="divImages" style="position: absolute; z-index: 3; background-color: #ffffef;
        display: none; text-align: center">
        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
            <ContentTemplate>
                <iframe style="margin-bottom: 0px;" id="main" name="main" scrolling="no"
                    width="100%" height="100%" frameborder="no" src="<%=ViewState["ImageURL"]%>">
                </iframe>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div id="divAttach" style="position: absolute; z-index: 3; background-color: #ffffef;
        display: none; text-align: center">
        <asp:UpdatePanel ID="updatepanel4" runat="server">
            <ContentTemplate>
                <iframe style="margin-bottom: 0px;" id="Iframe1" name="main" scrolling="no"
                    width="100%" height="100%" frameborder="no" src="<%=ViewState["AttachURL"]%>">
                </iframe>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div id="divPR" style="position: absolute; z-index: 3; background-color: #ffffef;
        display: none; text-align: center">
        <asp:UpdatePanel ID="updatepanel5" runat="server">
            <ContentTemplate>
                <uc3:UCSelectPR ID="UCSelectPR1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
